python - How do I make a matplotlib scatter plot square? - Stack Overflow
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.rcParams['backend'] = 'TkAgg'
x = [0, 0.2, 0.4, 0.6, 0.8]
y = [0, 0.5, 1, 1.5, 2.0]
colors = ['k']*len(x)
plt.scatter(x, y, c=colors, alpha=0.5)
plt.axes().set_aspect('equal', adjustable='datalim')
plt.xlim((0,2))
plt.ylim((0,2))
plt.grid(b=True, which='major', color='k', linestyle='--')
plt.savefig('{}.png'.format(rsID), dpi=600)
plt.close()
plt.clf()